﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.LogEntries.PlayerCharacterChangedLogEntry
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.LogEntries
{
  public class PlayerCharacterChangedLogEntry : LogEntry
  {
    [SaveableField(10)]
    public readonly Hero OldPlayerHero;
    [SaveableField(20)]
    public readonly Hero NewPlayerHero;

    internal static void AutoGeneratedStaticCollectObjectsPlayerCharacterChangedLogEntry(
      object o,
      List<object> collectedObjects)
    {
      ((LogEntry) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
      collectedObjects.Add((object) this.OldPlayerHero);
      collectedObjects.Add((object) this.NewPlayerHero);
    }

    internal static object AutoGeneratedGetMemberValueOldPlayerHero(object o)
    {
      return (object) ((PlayerCharacterChangedLogEntry) o).OldPlayerHero;
    }

    internal static object AutoGeneratedGetMemberValueNewPlayerHero(object o)
    {
      return (object) ((PlayerCharacterChangedLogEntry) o).NewPlayerHero;
    }

    public override CampaignTime KeepInHistoryTime => CampaignTime.Weeks(800f);

    public PlayerCharacterChangedLogEntry(Hero oldPlayerHero, Hero newPlayerHero)
    {
      this.OldPlayerHero = oldPlayerHero;
      this.NewPlayerHero = newPlayerHero;
    }
  }
}
